package com.heima.utils.thread;

import com.heima.model.wemedia.pojos.WmUser;

/**
 * @author shitou
 * @className WmTheadLocalUtil
 * @description: TODO
 */
public class WmTheadLocalUtil {
    private final static ThreadLocal<WmUser> WM_USER_THREAD_LOCAL = new ThreadLocal<>();

    // 存入线程
    public static void setWmUser(WmUser wmUser) {
        WM_USER_THREAD_LOCAL.set(wmUser);
    }

    // 从线程中取出
    public static WmUser getWmUser() {
        return WM_USER_THREAD_LOCAL.get();
    }

    // 清理线程
    public static void clearWmUser() {
        WM_USER_THREAD_LOCAL.remove();
    }
}
